package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

/**
 * 采购实体类
 */
@TableName("t_buyer")
public class BuyerBean {
    //    采购信息编号
    @TableId(value = "pk_buyerId", type = IdType.AUTO)
    private Integer id;

    //    采购员
    @TableField("b_user")
    private String user;

    //    采购日期
    @TableField("b_date")
    private LocalDate date = LocalDate.now();

    //    关联采购明细集合
    @TableField(exist = false)
    private List<BuyerInfoBean> product;

    //    关联供应商实体类
    @TableField(exist = false)
    private SupplierBean supplier;

    //    关联供应商编号
    @TableField("fk_supplierId")
    private Integer supplierId;

    public BuyerBean() {
    }

    public BuyerBean(String user, LocalDate date, Integer supplierId) {
        this.user = user;
        this.date = date;
        this.supplierId = supplierId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public List<BuyerInfoBean> getProduct() {
        return product;
    }

    public void setProduct(List<BuyerInfoBean> product) {
        this.product = product;
    }

    public SupplierBean getSupplier() {
        return supplier;
    }

    public void setSupplier(SupplierBean supplier) {
        this.supplier = supplier;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        this.supplierId = supplierId;
    }

    @Override
    public String toString() {
        return "BuyerBean{" +
                "id=" + id +
                ", user='" + user + '\'' +
                ", date=" + date +
                ", product=" + product +
                ", supplier=" + supplier +
                ", supplierId=" + supplierId +
                '}';
    }
}
